/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mapeServer;

/**
 *
 * @author carmelo
 */
public class Dispatcher implements Runnable {

    private Service _localServant;
    private InternalProxy proxy;
    
    
    public Dispatcher(Service servant) {
        this._localServant = servant;
        this.proxy = new InternalProxy();
    }

    @Override
    public void run() {
        String message;
        while (true) {
            message = _localServant.dequeue();
            //TODO validate message
            proxy.send(message);
        }
    }
}

